<script src="lib/plupload-2.1.2/js/plupload.full.min.js"></script>

<div class="row">

    <div class="col-sm-12">
        <div class="panel panel-primary">
            <div class="panel-heading">
                <strong>患者列表</strong>
            </div>

            <div class="panel-body">
                <a id="add_research" role="button" class="btn btn-primary btn-sm" ng-click="add_fee()">
                    <i class="glyphicon glyphicon-plus">
                    </i> 添加病人信息
                </a>

                <a id="add_research" role="button" class="btn btn-primary btn-sm" ng-click="export_patient()">
                    <i class="glyphicon glyphicon-plus">
                    </i> 导出病人信息
                </a>

                <div class="row center-block row_section">
                    <div class="span6  col-sm-3">
                        <label for="start" class="col-sm-4 control-label">起始时间</label>
                        <div class="col-sm-8">
                            <div class="dropdown">
                                <a class="dropdown-toggle" id="dropdown11" role="button" data-toggle="dropdown" data-target="#"
                                   href="">
                                    <div class="input-group">
                                        <input type="text" id="start" class="form-control" ng-model="start">
                                        <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
                                    </div>
                                </a>
                                <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
                                    <datetimepicker ng-model="start"
                                                    data-datetimepicker-config="{ dropdownSelector: '#dropdown11',startView:'day', minView:'day'}"></datetimepicker>
                                </ul>
                            </div>
                        </div>
                    </div>

                    <div class="span6  col-sm-3">
                        <label for="end" class="col-sm-4 control-label">结束时间</label>
                        <div class="col-sm-8">
                            <div class="dropdown">
                                <a class="dropdown-toggle" id="dropdown12" role="button" data-toggle="dropdown" data-target="#"
                                   href="">
                                    <div class="input-group">
                                        <input type="text" id="end" class="form-control" ng-model="end">
                                        <span class="input-group-addon"><i class="glyphicon glyphicon-calendar"></i></span>
                                    </div>
                                </a>
                                <ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
                                    <datetimepicker ng-model="end"
                                                    data-datetimepicker-config="{ dropdownSelector: '#dropdown12',startView:'day', minView:'day'}"></datetimepicker>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>


                <div class="row row_section form-horizontal" ng-hide="role == 4">


                    <div class="col-sm-3 ">
                        <label for="province" class="control-label col-sm-4">省份</label>
                        <div class="col-sm-8 ">
                            <select ng-model="provinceId"
                                    ng-change="provinceChanged(provinceId)"
                                    class="form-control" id="province"
                                    ng-options="item._id as item.name for item in provinces">
                                <option value="">请选择省份</option>
                            </select>

                        </div>
                    </div>

                    <div class="col-sm-3">
                        <label for="hospital" class="col-sm-4 control-label">医院</label>
                        <div class="col-sm-8 ">
                            <select ng-model="hospitalId"
                                    class="form-control" id="hospital"
                                    ng-options="item._id as item.name for item in hospitals">
                                <option value="">请选择医院</option>
                            </select>
                        </div>
                    </div>

                    <div class="col-sm-3">
                        <label for="disease" class="col-sm-4 control-label">疾病分类</label>
                        <div class="col-sm-8 ">
                            <select ng-model="diseaseId"
                                    class="form-control" id="disease"
                                    ng-options="item._id as item.name for item in diseases">
                                <option value="">请选择疾病分类</option>
                            </select>
                        </div>
                    </div>


                    <div class="col-sm-3">
                        <button type="button" ng-click="search()" class="btn btn-default">确定</button>
                    </div>
                </div>


                <div clss="table-container">
                    <div id="outerdiv">
                        <div id="innerdiv">
                            <table st-pipe="callServer" st-table="displayed" class="table">
                                <thead>
                                <tr>
                                    <th st-ratio="3">序号</th>
                                    <th st-ratio="5">姓名</th>
                                    <th st-ratio="3">性别</th>
                                    <th st-ratio="3">年龄</th>
                                    <th st-ratio="5">病历号</th>
                                    <th st-ratio="14">诊断</th>
                                    <th st-ratio="5">外周血</th>
                                    <th st-ratio="5">骨髓血</th>
                                    <th st-ratio="5">使用体积</th>
                                    <th st-ratio="13">ABioC治疗</th>
                                    <th st-ratio="5">就诊日期</th>
                                    <th st-ratio="5">治疗医生</th>
                                    <th st-ratio="3">收费</th>
                                    <th st-ratio="8">备注</th>
                                    <th st-ratio="8">反馈信息</th>
                                    <th st-ratio="3">随访</th>
                                    <th st-ratio="5">操作</th>
                                </tr>

                                </thead>
                                <tbody ng-hide="isLoading">
                                <tr ng-repeat="row in displayed">
                                    <th>{{row.order_no}}</th>
                                    <td>{{row.name}}</td>
                                    <td>
                                        <div ng-show="row.gender ==1">
                                            男
                                        </div>
                                        <div ng-show="row.gender ==2">
                                            女
                                        </div>
                                    </td>
                                    <td>{{row.age}}</td>
                                    <td>{{row.cardno}}</td>
                                    <td>{{row.diagnosis}}</td>
                                    <td>{{row.wzblood}}</td>
                                    <td>{{row.boneblood}}</td>
                                    <td>{{row.wz_volume * 1 + row.cell_volume * 1}}</td>
                                    <td>{{row.abioc_solution}}</td>
                                    <td>{{row.firstvistime | date : 'yyyy-MM-dd'}}</td>
                                    <th>{{row.doctor.name}}</th>
                                    <th>{{row.fee}}</th>
                                    <th>{{row.comment}}</th>
                                    <th>{{row.feedback}}</th>
                                    <td>
                                        <div ng-show="row.has_vistrack">
                                            <a href="#/vistrack/{{row._id}}">是</a>
                                        </div>

                                        <div ng-show="!row.has_vistrack">
                                            否
                                        </div>
                                    </td>
                                    <td>
                                        <button type="button" ng-click="editPatient($index)" class="btn btn-sm btn-primary">
                                            <i class="glyphicon glyphicon-pencil">
                                            </i>
                                        </button>

                                        <button type="button" ng-click="deletePatient($index)" class="btn btn-sm btn-danger">
                                            <i class="glyphicon glyphicon-remove-circle">
                                            </i>
                                        </button>
                                    </td>
                                </tr>
                                </tbody>
                                <tbody ng-show="isLoading">
                                <tr>
                                    <td colspan="4" class="text-center">Loading ... </td>
                                </tr>
                                <tfoot>
                                <tr>
                                    <!--<td class="text-center" st-pagination="" st-items-by-page="10" colspan="4"></td>-->
                                    <td colspan="16" class="text-center">
                                        <div st-items-by-page="10" colspan="40" st-pagination="" st-template="partials/pagination.custom.html"></div>
                                    </td>
                                </tr>
                                </tfoot>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <style type="text/css">
        .panel-body {
            width: 100%;
        }
        #innerdiv{
            width: 150%;
            height:100%;
            overflow-x: scroll;
        }
        #outerdiv{
            width: 100%;
            height:100%;
            overflow-x: scroll;
        }
    </style>

</div>